<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
    <meta charset="utf-8">
    <title>在线用户</title>
</head>
<body>
<%@include file="nav.jsp" %>

<h1>累计有 ${numbers} 人访问本网站</h1>
<table border="1" width="800px">
    <tr>
        <th>编号</th>
        <th>用户名</th>
        <th>登录时间</th>
        <th>上一次访问时间</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${online}" var="item" varStatus="status">
        <tr>
            <td>${status.count}</td>
            <td>${item.value.getAttribute('user').name}</td>
            <td>
                  ${item.value.creationTime}
                    <%--                <fmt:parseDate type="both" value="${item.value.creationTime}" pattern="yyyy-MM-dd HH:mm:ss"/>--%>
                    <%--                <fmt:formatDate value="${item.value.creationTime}" pattern="yyyy-MM-dd HH:mm:ss" />--%>
            </td>
            <td>
                ${item.value.lastAccessedTime}
            </td>
            <td>
                <c:if test="${self == item.value.id}">
                    下线
                </c:if>
                <c:if test="${self != item.value.id}">
                    <a href="outline?id=${item.value.id}">下线</a></td>

                </c:if>

        </tr>
    </c:forEach>
</table>


</body>
</html>
